<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>充值项添加</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/static/layuiadmin/layui/css/layui.css" media="all">
</head>
<body>

<div class="layui-form" style="padding: 20px 30px 0 0;">

    <div class="layui-form-item">
        <label class="layui-form-label">充值类型</label>
        <div class="layui-input-block">
            <input type="radio" name="type" value="1" title="充书币" lay-filter="recharge" checked>
            <input type="radio" name="type" value="2" title="充会员" lay-filter="recharge">
        </div>
    </div>

    <div class="layui-form-item" id="virtual_currency">
        <label class="layui-form-label">书币金额</label>
        <div class="layui-input-inline">
            <input type="number" name="virtual_currency" value="0" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item" id="vipday" style="display: none;">
        <label class="layui-form-label">会员天数</label>
        <div class="layui-input-inline">
            <input type="number" name="vipdays" value="0" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layui-hide">
        <input type="hidden" name="uid" value="{:think\\facade\\Request::param('id')}" />
        <input type="button" lay-submit lay-filter="LAY-data-recharge-submit" id="LAY-data-recharge-submit" value="确认">
    </div>
</div>
<script src="/static/layuiadmin/layui/layui.js"></script>
<script>
    layui.config({
        base: '/static/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form'], function(){
        var $ = layui.$
            ,form = layui.form;

        form.on('radio(recharge)', function(data){
            if(data.value == 2)
            {
                $('#vipday').show();
                $('#virtual_currency').hide();
            }else{
                $('#vipday').hide();
                $('#virtual_currency').show();
            }

        });

    })

</script>
</body>
</html>